<%@page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html class="root61">
<head>
	<%@include file="/views/common/include/taglib.jsp"%>
	<%@include file="/views/common/include/head.jsp"%>
	<link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/sectionparent.css" source="widget" />
	<link type="text/css" rel="stylesheet" href="${ctx }/css/dlifestyle/admin.css" source="widget" />
</head>
<body style="margin: 0px">
	<section class="mainborder">
       <section class="edit_scrollable padder">
         <div class="edit_content">
					 <div class="form" >
						<input id="id" type="hidden" value="${role.id }">
						<input id="selmenus" type="hidden" value="${selmenus}">
						<input id="selcells" type="hidden" value="${selcells}">
						<div class="item">
							<label class="col-sm-1 editlable">角色类型：</label>
							<div class="fl">
				                <select id="roleType" class="editform-control" style="height:29px;width:100px;" <c:if test="${role.id != null && role.id != 0}">disabled="disabled"</c:if> onblur="checkRoleType();">
			                    	<option value="-1" <c:if test="${role.roleType == -1 }">selected="selected"</c:if>>角色类型</option>
			                    	<c:forEach items="${permissions}" var="item">
			                    		<option value="${item.id}" <c:if test="${role.roleType == item.id }">selected="selected"</c:if>>${item.name}</option>
			                    	</c:forEach>
			                    </select>
		                  		<em class="emStyle">*</em>
		                   </div>
						</div>
							
						<div class="item" id="cellArea" <c:if test="role.roleType == 0">style="display:none;"</c:if>>
							<label class="col-sm-1 editlable">小区范围：</label>
							<div class="fl">
								<button class="editform-control" id="cells" class="text" style="cursor: pointer;" onclick="chooseCell('${role.id}');">点击设置</button>
								<em class="emStyle">*</em>
							</div>
						</div>
							
						<div class="item" id="functionArea">
							<label class="col-sm-1 editlable">功能权限：</label>
							<div class="fl">
								<button class="editform-control" id="menus" class="text" style="cursor: pointer;" onclick="setRoleMenu('${role.id}');">点击设置</button>
								<em class="emStyle">*</em>
							</div>
						</div>
					    <div class="item">
							<label class="col-sm-1 editlable">角色名：</label>
					   		<div class="fl">
								<input class="editform-control" id="roleName" value="${role.roleName}" type="text" maxlength="20" class="text" placeholder="请输入角色名" required onblur="checkRoleName();">
								<em class="emStyle">*</em>
							</div>
						</div>
						<div class="item">
							<label class="col-sm-1 editlable">描述：</label>
							<div class="fl">
								<input class="editform-control" id="descrip" value="${role.descrip}" type="text" maxlength="20" class="text" placeholder="请输入角色描述" required>
							</div>
						</div>
					</div>
			</div>
		</section>
	</section>
                 	
</body>
	<script src="${ctx}/js/controllers/system/role/RoleEditController.js" type="text/javascript"></script>
	<script type="text/javascript">
		var ctx = '${ctx}';
		setCtx(ctx);
		
		parent.$('#selectRm').val($("#selmenus").val());
		parent.$('#selectedCellId').val($("#selcells").val());
	</script>
	<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
	<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>
</html>
